#include <stdio.h>

int main()
{
	char ch[1000]={0};
	fgets(ch,sizeof(ch),stdin);
	int i;
	int letters=0;
	int spaces=0;
	int number=0;
	int other=0;
	for(i=0;ch[i]!='\n';i++)
	{
		if((ch[i]>='a' && ch[i]<='z') || (ch[i]>='A' && ch[i]<='Z'))
		letters++;
		else if(ch[i]==' ')
		spaces++;
		else if(ch[i]>='0' && ch[i]<='9')
		number++;
		else
		other++;
	}
	
	printf("%d\n",letters);
	printf("%d\n",spaces);
	printf("%d\n",number);
	printf("%d\n",other);
	return 0;
}